#!/usr/bin/perl -w

use strict;
use warnings;
use Data::Dumper;

use Mojolicious::Lite;
use Mojolicious::Plugin::Database;
use DBI;

my $database     = 'data/data.db';


# database initialization
plugin 'database' => {
    dsn      => "dbi:SQLite:dbname=$database",
    username => q{},
    password => q{},
    options  => { RaiseError => 1 },
    helper   => 'db',

};


# /register
######################

any 'register' => sub {
   my $self     = shift;
   my $name     = $self->param('name');
   my $id       = $self->param('id');
   
   print "ended in register\n";
   
   print "user: $name\n";
   print "pass: $id\n";
   
   $self->render(text => 'OK');
};

app->start;
